home *** CD-ROM | disk | FTP | other *** search
/ .net 2002 March / DotNetMagazine-Issue107-Coverdisc-NET107-02-03-PCMac.bin / pc / PC Software / free_browsing / DavesQckSearchDbar3-14 / dqsd.exe / searches / jsref.xml < prev    next >
Text File  |  2002-09-10  |  7KB  |  171 lines

  1. <search function="jsref">
  2.   <name>Javascript reference</name>
  3.   <description>Search references of various flavors of Javascript.
  4.     <div class="helpboxDescLabels">Usage:</div>
  5.     <table class="helpboxDescTable">
  6.       <tr><td>jsref <<i>item</i>> [/<i>reference</i>] [/unlucky]<br/>
  7.         Note: if <<i>item</i>> is empty, the search leads to the appropriate reference page.
  8.       </td></tr>
  9.     </table>
  10.     <div class="helpboxDescLabels">Switches:</div>
  11.       <table class="helpboxDescTable">
  12.         <tr><td>/<i>reference</i></td><td> - </td><td>Search one of the following references:</td></tr>
  13.         <tr><td></td><td></td><td>
  14.           <b>The ones that use Google</b> (they take you directly to the page):<br/>
  15.           <table class="helpboxDescTable">
  16.             <tr><td>1.3</td><td> - </td><td>1.3 Netscape version</td></tr>
  17.             <tr><td>1.4</td><td> - </td><td>1.4 Netscape version</td></tr>
  18.             <tr><td>1.5</td><td> - </td><td>1.5 Netscape version</td></tr>
  19.             <tr><td><b>5.6</b></td><td> - </td><td>5.6 Microsoft version <b>(default)</b></td></tr>
  20.             <tr><td>7</td><td> - </td><td>.NET Microsoft version</td></tr>
  21.           </table>
  22.           <b>The one that uses the MS search</b>:<br/>
  23.           <table class="helpboxDescTable">
  24.             <tr><td>ms</td><td> - </td><td>Microsoft's latest version</td></tr>
  25.           </table>
  26.         </td></tr>
  27.         <tr><td>/unlucky</td><td> - </td><td>Try this if you feel unlucky (only for Google-based switches)</td></tr>
  28.       </table>
  29.     <div class="helpboxDescLabels">Examples:</div>
  30.     <table class="helpboxDescTable">
  31.       <tr><td>jsref /1.3</td></tr>
  32.       <tr><td>jsref split</td></tr>
  33.       <tr><td>jsref split /1.5</td></tr>
  34.       <tr><td>jsref split /7</td></tr>
  35.       <tr><td>jsref logical or /unlucky</td></tr>
  36.       <tr><td>jsref abstract /7</td></tr>
  37.       <tr><td>jsref abstract /ms</td></tr>
  38.       <tr><td>jsref /1.3</td></tr>
  39.     </table>
  40.   </description>
  41.   <link>http://developer.netscape.com/docs/manuals/javascript.html</link>
  42.   <category>Computers</category>
  43.   <contributor>MLL, from jdk.xml</contributor>
  44.   
  45.   <form name="jsreff_gg" action="http://www.google.com/search" method="get">
  46.     <input type="hidden" name="q"/>
  47.     <input type="hidden" name="meta" value=""/>
  48.     <input type="hidden" name="btnI" value="I'm Feeling Lucky"/>
  49.   </form>
  50.  
  51.  <form name="jsreff_ggul" action="http://www.google.com/search" method="get">
  52.     <input type="hidden" name="q"/>
  53.     <input type="hidden" name="meta" value=""/>
  54.   </form>
  55.  
  56.   <form name="jsreff_ms"
  57.         method="get"
  58.         action="http://search.microsoft.com/default.asp">
  59.     <input type="hidden" name="so" value="RECCNT" />
  60.     <input type="hidden" name="siteid" value="us/dev" />
  61.     <input type="hidden" name="p" value="1" />
  62.     <input type="hidden" name="nq" value="NEW" />
  63.     <input type="hidden" name="qu" value="" />
  64.     <input type="hidden" name="boolean" value="ALL" />
  65.     <input type="hidden" name="ig" value="02" />
  66.     <input type="hidden" name="i" value="60" />
  67.   </form>
  68.  
  69.   <script><![CDATA[
  70.     // Uses Google I'm feeling lucky search
  71.     function jsref(q)
  72.     {
  73.       var defpage = 'http://msdn.microsoft.com/library/en-us/script56/html/js56jslrfjscriptlanguagereference.asp';
  74.       if (q == "")
  75.         openSearchWindow(defpage);
  76.       else
  77.       {
  78.         var args = parseArgs(q, "1.3, 1.4, 1.5, 5.6, 7, ms, unlucky");
  79.         if( args.q == "?" ) return nullArgs( "jsref", "?" );
  80.  
  81.         var myform = document.jsreff_gg;
  82.         var myfield = myform.q;
  83.         var ul = false, ms=false
  84.  
  85.         /*
  86.         we somehow shoot in the dark here. putting args.q in a inurl operator would be much better,
  87.         but google doesn't accept "inurl:mychars" if mychars aren't a *complete* dir/file name
  88.         the required words 'jscript' 'requirements' seem to bring the most appropriate URL to 1st rank
  89.         the query below may be fine-tuned somewhat more
  90.         */
  91.         var query = args.q + ' jscript requirements inurl:"script56" site:msdn.microsoft.com';
  92.  
  93.         if (args.switches.length > 0)
  94.         {
  95.           var k=0;
  96.           for( var j=0; j<args.switches.length; j++ )
  97.           {
  98.             switch (args.switches[j].name)
  99.             {
  100.               case "unlucky":
  101.                 ul = true;
  102.                 myform = document.jsreff_ggul;
  103.                 myfield = myform.q;
  104.                 break;
  105.               case "1.3":
  106.                 k++;
  107.                 defpage = 'http://developer.netscape.com/docs/manuals/js/client/jsref/index.htm';
  108.                 query = args.q + ' inurl:jsref -inurl:ix -inurl:whatsnew site:developer.netscape.com';
  109.                 break;
  110.               case "1.4":
  111.                 k++;
  112.                 defpage = 'http://developer.netscape.com/docs/manuals/js/core/jsref14/index.htm';
  113.                 query = args.q + ' inurl:jsref14 -inurl:ix site:developer.netscape.com';
  114.                 break;
  115.               case "1.5":
  116.                 k++;
  117.                 defpage = 'http://developer.netscape.com/docs/manuals/js/core/jsref15/contents.html';
  118.                 query = args.q + ' inurl:jsref15 -inurl:ix site:developer.netscape.com';
  119.                 break;
  120.               case "5.6":
  121.                 k++;
  122.                 //we don't change anything : default search - political choice <g>
  123.                 break;
  124.               case "7":
  125.                 k++;
  126.                 defpage = 'http://msdn.microsoft.com/library/en-us/jscript7/html/jsoriProgrammingWithJScriptNET.asp';
  127.                 /*
  128.                 we somehow shoot in the dark here. putting args.q in a inurl operator would be much better,
  129.                 but google doesn't accept "inurl:mychars" if mychars aren't a *complete* dir/file name
  130.                 the required words 'jscript' 'requirements' seem to bring the most appropriate URL to 1st rank
  131.                 the query below may be fine-tuned somewhat more
  132.                 */
  133.                 var query = args.q + ' jscript requirements inurl:"jscript7" site:msdn.microsoft.com';
  134.                 break;
  135.               case "ms":
  136.                 k++;
  137.                 ms = true;
  138.                 defpage = 'http://msdn.microsoft.com/library/default.asp';
  139.                 query = args.q;
  140.                 myform = document.jsreff_ms;
  141.                 myfield = myform.qu
  142.                 break;;
  143.               default:
  144.                 nullArgs ( "jsref" , "?" );
  145.                 return false;
  146.             } //switch
  147.           } //for
  148.           if( k > 1 || (ul && ms) )
  149.           {
  150.             nullArgs ( "jsref" , "?" );
  151.             return false;
  152.           }
  153.         } //if
  154.         if (args.q == "")
  155.         {
  156.           openSearchWindow(defpage);
  157.           return;
  158.         }
  159.         myfield.value = query;
  160.         submitForm(myform);
  161.       }
  162.     }
  163.   ]]></script>
  164.  
  165.   <copyright>
  166.   Copyright (c) 2002 David Bau
  167.   Distributed under the terms of the
  168.   GNU Public License, Version 2 (http://www.gnu.org/copyleft/gpl.txt)
  169.   </copyright>
  170. </search>
  171.